<?php
/**
 * Created by JetBrains PhpStorm.
 * User: leon
 * Date: 10/13/12
 * Time: 8:02 PM
 * To change this template use File | Settings | File Templates.
 */


namespace BWL\webshopBundle\Entity;

use Doctrine\ORM\Mapping as ORM;


/**
 * @ORM\Entity
 * @ORM\Table(name="item")
 */
class Item
{
  /**
   * @ORM\Id
   * @ORM\Column(type="integer")
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  protected $id;

  /**
   * @ORM\Column(type="string", length=100)
   */
  protected $name;
  /**
   * @ORM\Column(type="string", length=100)
   */
  protected $image;
  /**
   * @ORM\Column(type="decimal", scale=2)
   */
  protected $salePrice;

  /**
   * @ORM\Column(type="decimal", scale=2)
   */
  protected $basePrice;

  /**
   * @ORM\Column(type="text")
   */
  protected $description;
  /**
   * @ORM\OneToMany(targetEntity="Ordering", mappedBy="item")
   */
  protected $orderings;

  /**
   * @ORM\OneToMany(targetEntity="ItemItem", mappedBy="part_item")
   */
  protected $part_items;

  /**
   * @ORM\OneToMany(targetEntity="ItemItem", mappedBy="whole_item")
   */
  protected $whole_items;

  /**
   * @ORM\OneToMany(targetEntity="Requirement", mappedBy="item")
   */
  protected $requirements;

  /**
   * @ORM\OneToMany(targetEntity="Assignment", mappedBy="item")
   */
  protected $assignments;

  /**
   * @ORM\Column(type="integer")
   */
  protected $dispatched_in_days;

  public function getItems() {
    return $this->items;
  }

  /**
   * @ORM\OneToMany(targetEntity="ShoppingCart", mappedBy="item")
   */
  protected $shoppingCarts;

  public function getShoppingCarts(){
    return $this->shoppingCarts;
  }

  /**
   * Constructor
   */
  public function __construct() {
    $this->item = new \Doctrine\Common\Collections\ArrayCollection();
  }

  /**
   * Get id
   *
   * @return integer
   */
  public function getId() {
    return $this->id;
  }

  /**
   * Set name
   *
   * @param string $name
   * @return Item
   */
  public function setName($name) {
    $this->name = $name;

    return $this;
  }

  /**
   * Get name
   *
   * @return string
   */
  public function getName() {
    return $this->name;
  }

  /**
   * Set image
   *
   * @param string $image
   * @return Item
   */
  public function setImage($image) {
    $this->image = $image;

    return $this;
  }

  /**
   * Get image
   *
   * @return string
   */
  public function getImage() {
    return $this->image;
  }

  /**
   * Set price
   *
   * @param float $price
   * @return Item
   */
  public function setSalePrice($salePrice) {
    $this->salePrice = $salePrice;

    return $this;
  }

  /**
   * Get price
   *
   * @return float
   */
  public function getSalePrice() {
    return $this->salePrice;
  }

  /**
   * Set description
   *
   * @param string $description
   * @return Item
   */
  public function setDescription($description) {
    $this->description = $description;

    return $this;
  }

  /**
   * Get description
   *
   * @return string
   */
  public function getDescription() {
    return $this->description;
  }

  public function setBasePrice($basePrice) {
    $this->basePrice = $basePrice;
  }

  public function getBasePrice() {
    return $this->basePrice;
  }

  public function getOrderings() {
    return $this->orderings;
  }


  public function getPartItems() {
    return $this->part_items;
  }

  public function getWholeItems() {
    return $this->whole_items;
  }

  public function setDispatchedInDays($dispatched_in_days) {
    $this->dispatched_in_days = $dispatched_in_days;
  }

  public function getDispatchedInDays() {
    return $this->dispatched_in_days;
  }




}